package com.groupnections.client.Entities;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.groupnections.shared.Entity;

public class ConnectEntity {

	public ConnectEntity(Entity entity, String entityID) {

		final EntitiesDatabaseServerCallsAsync databaseServerCalls = GWT
				.create(EntitiesDatabaseServerCalls.class);

		databaseServerCalls.connectEntity(entity, entityID,
				new AsyncCallback<Void>() {

					public void onSuccess(Void result) {

						new ListEntities();
					}

					public void onFailure(Throwable caught) {
						// Show the RPC error message to the user

					}

				});

	}

}
